<?php

class A {
          function foo() {
                echo 'from class A';
          }
}

class B extends A {
    function B() {
         aggregate_methods($this,'C');
    }
}

class C {
          function foo() {
                echo 'from class C';
          }
}

$myclass = new B();
$myclass->foo();
// This will print 'from class A'

?>